﻿using System;
using System.Collections.Generic;
using System.Text;
using VietKinsNutrition.Data;
using System.Windows.Forms;
using System.Data;

namespace VietKinsNutrition.Bussiness
{
    public class ClsTblDm_HoadondichoBLL : ClsExel
    {
        #region Bien
        private float _TongTien;
        private float _ChiPhiKhac;
        private float _SoTienChi;
        public float ChiPhiKhac
        {
            set { _ChiPhiKhac = value; }
        }
        public float SoTienChi
        {
            set { _SoTienChi = value; }
            get { return _SoTienChi; }
        }
        public float TongTien
        {
            set { _TongTien = value; }
            get { return _TongTien; }
        }
        #endregion
        #region Thao tác xuất  file exel
        public void ExportFileExel(DataGridView Gird, SaveFileDialog FileSave, DateTime dateReport, string chi_nt, string chi_mg, int iTongsotre_nt, int iTongsotre_mg)
        {
            _Start = 6;
            string sTenso = null, sTentruong = null, sTenphong = null, sTieude = null, FileName = null;
            DataTable dt;
            ClsTblDmTruonghocDAL ClsTblDmTruonghocdal = new ClsTblDmTruonghocDAL();
            dt = ClsTblDmTruonghocdal.TblTruong();
            ClsExport2ExcelBLL ClsExport2Excelbll = new ClsExport2ExcelBLL();
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                sTenso = dr["TensoGD"].ToString();
                sTentruong = dr["Tentruong"].ToString();
                sTenphong = dr["TenphongGD"].ToString();
                sTieude = "TỔNG HỢP HÓA ĐƠN ĐI CHỢ";
                FileName = sTieude + ".xls";

                FileSave.FileName = FileName;
            }
            this.ExportHoadondicho(1, sTieude, sTenso, sTenphong, sTentruong, Gird, FileSave.FileName, dateReport, this._ChiPhiKhac.ToString(), chi_nt, chi_mg, iTongsotre_nt, iTongsotre_mg);
        }
        public override void ExportHoadondicho(int SHD, string Tieude, string Tenso, string Tenphong, string Tentruong, DataGridView Grid, string FileName, DateTime dateReport, string sChiphiphatsinh, string chi_nt, string chi_mg, int iTongsotre_nt, int iTongsotre_mg)
        {
            base.ExportHoadondicho(SHD, Tieude, Tenso, Tenphong, Tentruong, Grid, FileName, dateReport, sChiphiphatsinh, chi_nt, chi_mg, iTongsotre_nt, iTongsotre_mg);
        }
        #endregion
    }
}
